﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PFMCandidate;
using System.Collections;

namespace PFMFinders
{
    public class PFMFileFinderEnumerator:IEnumerator<Candidate>
    {
        private PFMFileFinder o_FMFileFinder=null;

        public PFMFileFinderEnumerator(PFMFileFinder aFMFileFinder)
        {
            // TODO: Complete member initialization
         
            if (aFMFileFinder != null)
  			o_FMFileFinder = aFMFileFinder;
        }
       
		int i_Index = -1;

	
		public bool MoveNext()
		{
            bool bResult = (i_Index+1) < o_FMFileFinder.GetCount();
			if (bResult)
                i_Index++;

			return bResult;
		}

		public Candidate GetCurrent()
		{
            return o_FMFileFinder[i_Index];
		}

        //public  object Current
        //{
        //    get
        //    {
        //        return GetCurrent();
        //    }
        //}

		public void Reset()
		{
			i_Index = -1;
		}
        public  Candidate Current
        {
            get { return GetCurrent(); }
        }
        public void Dispose()
        {            
        }
        object IEnumerator.Current
        {
            get { return GetCurrent(); }
        }
    }
}
